<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQiiMediaTinyTable extends Migration
{
    /**
     * Schema table name to migrate
     * @var string
     */
    public $set_schema_table = 'qii_media_tiny';

    /**
     * Run the migrations.
     * @table qii_media_tiny
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable($this->set_schema_table)) return;
        Schema::create($this->set_schema_table, function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id')->comment('ID');
            $table->string('name', 120)->comment('图片名称');
            $table->char('ident', 32)->default('')->comment('md5');
            $table->string('path')->nullable()->default(null)->comment('保存位置');
            $table->unsignedInteger('time')->default('0')->comment('时长(秒)');
            $table->unsignedInteger('size')->default('0')->comment('大小(KB)');
            $table->char('ext', 10)->default('')->comment('扩展名');
            $table->unsignedInteger('last_modified')->default('0')->comment('更新时间');
            $table->unsignedInteger('storages_id')->default('0')->comment('云存储附件ID');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
     public function down()
     {
       Schema::dropIfExists($this->set_schema_table);
     }
}
